package com.twu.biblioteca;

import java.io.PrintStream;
import java.lang.reflect.Array;
import java.util.ArrayList;

/**
 * Created by kpradhan on 3/10/14.
 */
public class Menu {
    private ArrayList<String> options;

    public Menu(ArrayList<String> options) {
        this.options = options;
    }

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < options.size(); i++) {
            result.append((i+1));
            result.append(". ");
            result.append(options.get(i));
        }
        return String.valueOf(result);
    }

    public String getOption(int i) {
        return options.get(i-1);
    }
}
